with Legend.Interactives;
with SDL.Events;
with String_Lists;
with String_Sets;
with Character_Lists;
package Legend.Game_Titles is

   type Menu_Level_Type is (ml_Main, ml_Load);

   type Game_Title_Type is new Interactives.Interactive_Type with record
      Level : Menu_Level_Type := ml_Main;
      Focus : Uint16_t := 0;
   end record;

   overriding
   procedure Paint (this : in out Game_Title_Type);

   overriding
   procedure On_Key_Up (
      this          : in out Game_Title_Type;
      Message       : SDL.Events.Keyboard_Event_t;
      Cancel_Bubble : in out Boolean
      );

   type Game_Over_Type is new Interactives.Interactive_Type with null record;

   overriding
   procedure Paint (this : in out Game_Over_Type);

   procedure On_Key_Up (
      this          : in out Game_Over_Type;
      Message       : SDL.Events.Keyboard_Event_t;
      Cancel_Bubble : in out Boolean
      );

   type Role_Creator_Type is new Interactives.Interactive_Type with record
      Password : String(1..8) := (1..8 => ' ');
   end record;

   overriding
   procedure Paint (this : in out Role_Creator_Type);

   procedure On_Key_Up (
      this          : in out Role_Creator_Type;
      Message       : SDL.Events.Keyboard_Event_t;
      Cancel_Bubble : in out Boolean
      );

   procedure Create_Random_Attr (this : in out Role_Creator_Type);

   procedure Create_Full_Attr (this : in out Role_Creator_Type);

   type Name_Creator_Type is new Interactives.Interactive_Type with record
      Name       : String_Lists.List;
      Input_Code : Character_Lists.List;
      Options    : String_Lists.List;
      Page_First : String_Lists.Cursor := String_Lists.No_Element;
      Code_Table : String_Sets.Set;
   end record;

   overriding
   procedure Paint (this : in out Name_Creator_Type);

   procedure On_Key_Up (
      this          : in out Name_Creator_Type;
      Message       : SDL.Events.Keyboard_Event_t;
      Cancel_Bubble : in out Boolean
      );

   overriding
   procedure Initialize (this : in out Name_Creator_Type);

   procedure Reload_Options (this : in out Name_Creator_Type);

   function To_String (List : String_Lists.List) return String;

   function To_String (List : Character_Lists.List) return String;

   function To_String (
      List : String_Lists.List; 
      First : String_Lists.Cursor
      ) return String;

end Legend.Game_Titles;
